package cn.gson.crm.model.pojos;

import org.apache.ibatis.annotations.One;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
@Table(name = "product")
public class Pro {
    private Integer cpId;
    private Long categoryId;
    private String cpName;
    private String cpDesc;
    private List<ProductXq> productXqList;
    private List<Company> company;
    private Category category;
    private List<Specifications> specificationsList;
    private List<Purchasexq> purchasexqs;




    @Id
    @Column(name = "cp_id")
    @GeneratedValue(generator  =  "seq",strategy  =  GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name  =  "seq",sequenceName  =  "tmq",
            initialValue  =  1,allocationSize  =  1)
    public Integer getCpId() {
        return cpId;
    }

    public void setCpId(Integer cpId) {
        this.cpId = cpId;
    }


    @OneToMany(mappedBy = "pro")
    public List<ProductXq> getProductXqList() {
        return productXqList;
    }

    public void setProductXqList(List<ProductXq> productXqList) {
        this.productXqList = productXqList;
    }

    @OneToMany(mappedBy = "pro2")
    public List<Company> getCompany() {
        return company;
    }

    public void setCompany(List<Company> company) {
        this.company = company;
    }


    @ManyToOne
    @JoinColumn(name = "category_id")
    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }


    @Basic
    @Column(name = "cp_name")
    public String getCpName() {
        return cpName;
    }

    public void setCpName(String cpName) {
        this.cpName = cpName;
    }

    @Basic
    @Column(name = "cp_desc")
    public String getCpDesc() {
        return cpDesc;
    }

    public void setCpDesc(String cpDesc) {
        this.cpDesc = cpDesc;
    }

    @OneToMany(mappedBy = "pro6")
    public List<Specifications> getSpecificationsList() {
        return specificationsList;
    }

    @OneToMany(mappedBy = "pro10")
    public List<Purchasexq> getPurchasexqs() {
        return purchasexqs;
    }

    public void setPurchasexqs(List<Purchasexq> purchasexqs) {
        this.purchasexqs = purchasexqs;
    }

    public void setSpecificationsList(List<Specifications> specificationsList) {
        this.specificationsList = specificationsList;
    }


    public Pro() {
    }



}

